from typing import Optional

from bct.tools.common.bct4.base_dto import JsonDTO


class PartyAccountDTO(JsonDTO):
    id: Optional[str]
    party_id: Optional[str]
    account_name: Optional[str]
    status: Optional[str]

    def to_dict(self):
        return {
            'id': self.id,
            'partyId': self.party_id,
            'accountName': self.account_name,
            'status': self.status
        }


class CountryPartyDTO(JsonDTO):
    """交易对手"""
    party_id: Optional[str]
    party_code: Optional[str]
    party_name: Optional[str]
    party_status: Optional[str]
    otc_status: Optional[str]
    swap_status: Optional[str]

    def to_dict(self):
        return {
            "partyId": self.party_id,
            "partyCode": self.party_code,
            "partyName": self.party_name,
            "partyStatus": self.party_status,
            "otcStatus": self.otc_status,
            "swapStatus": self.swap_status
        }
